package com.yu.crm.domain.pojo;

import java.math.BigDecimal;

import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 部门信息表
 * </p>
 *
 * @author donnie-bin
 * @since 2019-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@JSONType(orders = {"id"})
@ApiModel(value="CrmDepartment对象", description="数据字典表")
public class CrmDepartment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "部门id", required = false)
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    @ApiModelProperty(value = "上级部门id", required = false)
    @TableField("pid")
    private Long pid;

    @ApiModelProperty(value = "部门名称", required = true)
    @NotEmpty(message = "部门名称不能为空")
    @TableField("department_name")
    private String departmentName;

    @ApiModelProperty(value = "部门描述", required = false)
    @TableField("department_desc")
    private String departmentDesc;

    @ApiModelProperty(value = "简称或别名", required = false)
    @TableField("department_short_name")
    private String departmentShortName;

    @ApiModelProperty(value = "全路径名称", required = false)
    @TableField("department_all_name")
    private String departmentAllName;

    @ApiModelProperty(value = "部门类别", required = false)
    @TableField("department_type")
    private Integer departmentType;

    @ApiModelProperty(value = "是否重点领域部门 1是0否", required = false)
    @TableField("is_domain")
    private Integer isDomain;

    @ApiModelProperty(value = "坐标系类型 coordinate_type", required = false)
    @TableField("coordinate_type")
    private Integer coordinateType;

    @ApiModelProperty(value = "经度", required = false)
    @TableField("longitude")
    private BigDecimal longitude;

    @ApiModelProperty(value = "纬度", required = false)
    @TableField("latitude")
    private BigDecimal latitude;

    @ApiModelProperty(value = "排序字段", required = false)
    @TableField("sort")
    private Long sort;

    @ApiModelProperty(value = "创建时间", required = false)
    @TableField("gmt_create")
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改时间", required = false)
    @TableField("gmt_modified")
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "是否已删除 yes_no", required = false)
    @TableField("is_deleted")
    private Integer isDeleted;

    @ApiModelProperty(value = "上级部门名称", required = false)
    @TableField(exist = false)
    private String pDepartmentName;

    @ApiModelProperty(value = "下级列表", required = false)
    @TableField(exist = false)
    private List<CrmDepartment> children;
}
